package com.tao.common.creo.enums;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.Getter;

@AllArgsConstructor
@Getter
public enum ResultCode {
    SUCCESS(1000, "操作成功"),
    // 服务器报错
    ERROR(2000, "服务繁忙请稍后重试"),

    // 业务相关的
    // 操作失败，但是服务器不存在异常
    FAILED (3000, "操作失败"),
    FAILED_UNAUTHORIZED (3001, "未授权"),
    FAILED_PARAMS_VALIDATE (3002, "参数校验失败"),
    FAILED_NOT_EXISTS (3003, "资源不存在"),
    FAILED_ALREADY_EXISTS (3004, "资源已存在"),
    FAILED_USER_EXISTS (3101, "用户已存在"),
    FAILED_USER_NOT_EXISTS (3102, "用户不存在"),
    FAILED_LOGIN (3103, "用户名或密码错误"),
    FAILED_USER_BANNED (3104, "您已被列入黑名单, 请联系管理员."),
    FAILED_PHONE        (3105, "手机号不合法"),
    FAILED_PHONE_CODE   (3106, "获取验证码过于频繁, 请稍后重试"),
    FAILED_TIME_LIMIT   (3106, "获取验证码次数超过限制, 请明天再试"),
    FAILED_NOT_GET_CODE   (3107, "验证码已过期, 操作失败"),
    FAILED_PHONE_CODE_ERROR   (3108, "验证码错误, 操作失败"),

    // 竞赛相关
    EXAM_START_TIME_BEFORE_CURRENT_TIME (3201, "竞赛开始时间不能早于当前时间"),
    EXAM_START_TIME_AFTER_END_TIME      (3202, "竞赛开始时间不能晚于竞赛结束时间"),
    EXAM_QUESTION_NOT_EXISTS            (3203, "为竞赛添加的题目不存在"),
    EXAM_NOT_EXISTS                     (3204, "竞赛不存在"),
    EXAM_IS_START_EXISTS                 (3204, "当前竞赛已开赛, 操作失败"),
    EXAM_IS_PUBLISH                       (3205, "当前竞赛已经发布, 操作失败"),
    EXAM_IS_END                         (3206, "当前竞赛已完赛, 操作失败"),
    EXAM_QUESTION_NULL              (3207, "当前竞赛下题目为空, 操作失败"),
    EXAM_NOT_PUBLISH                       (3208, "当前竞赛未发布, 操作失败"),
    USER_EXAM_HAS_ENTER                     (3209, "当前竞赛已报名, 请勿重复报名"),
    // 题目相关
    FAILED_QUESTION_EXISTS              (4001, "标题已存在"),
    QUESTION_NOT_EXISTS                 (4002, "题目不存在"),
    ;
    private int code;
    private String message;

}
